var MongoClient=require('mongodb').MongoClient;
var dbUrl='mongodb://127.0.0.1:27017' 
var dbName='koa'
MongoClient.connect(dbUrl,(err,client)=>{
    if (err) {
        console.log(err)
        return;
    }
    var db= client.db(dbName);

    db.collection('user').insertOne({'username':'zhangshan','age':23},(err,result)=>{
        if (err) {
            console.log(err)
            return;
        }else{
            console.log('增加成功')
        }
    })
})